package com.itheima.mapper;

import com.itheima.pojo.Brand;
import java.util.List; // 修改这里

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

public interface BrandMapper {
    @Select("select * from tb_brand")
    @ResultMap("brandResultMap")
    List<Brand> selectAll(); // 修改这里

    @Insert("insert into tb_brand values(null,#{brandName},#{companyName},#{ordered},#{description},#{status})")
    void add(Brand brand);

    void deleteByIds(@Param("ids")int[]ids);
    @Select("select * from tb_brand limit #{begain},#{size}")

    List<Brand> selectByPage(@Param("begain")int begain,@Param("size")int size);

    @Select("select count(*) from tb_brand")
    int selectTotalCount();
    List<Brand> selectByPageandCondition(@Param("begain") int begain, @Param("size") int size, @Param("brand") Brand brand);



    int selectTotalCountByCondition(@Param("brand")Brand brand);
}
